<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" type="text/css" href="https://www.layuicdn.com/layui/css/layui.css"/>
    <!--    <link rel="stylesheet" href="//res.layui.com/layui/dist/css/layui.css"  media="all">-->
</head>
<body>

<table class="layui-hide" id="test"></table>


<!--<script src="//res.layui.com/layui/dist/layui.js" charset="utf-8"></script>-->

<script src="https://www.layuicdn.com/layui/layui.js"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述 JS 路径需要改成你本地的 -->

<script>
    layui.use('table', function () {
        var table = layui.table;
        table.render({
            elem: '#test',
            // url: 'http://localhost:8084/demo/table/user/',
            url:'http://192.168.0.103:8005/test/data',
            cellMinWidth: 80,
            // response:{
            //     statusName:'code',
            //     statusCode: 200,
            //     msgName:'msg',
            //     dataName:'data'
            // },
            parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                return {
                    "code": res.code, //返回状态码
                    "msg": res.msg, //解析提示信息
                    "count": res.data.count, //后台返回的数据总条数，用于自定义分页使用
                    "data": res.data.list //解析数据列表
                };
            },
            cols: [[
                {field: 'id', width: 80, title: 'ID', sort: true},
                {field: 'networkName', width: 80, title: '网点名称'},
                {field: 'bankName', width: 80, title: '银行名称', sort: true},
                {field: 'personCount', width: 80, title: '人员数'},
                {field: 'asset', title: '资产', width: '30%', minWidth: 100},
                {field: 'experience', title: '积分', sort: true},
                {field: 'score', title: '评分', sort: true},
                {field: 'classify', title: '职业'},
                {field: 'wealth', width: 137, title: '财富', sort: true}
            ]]
        });
    });
</script>

</body>
</html>
